package com.bookcycle.panda.webfront.controller;

import com.baomidou.kisso.SSOHelper;
import com.baomidou.kisso.security.token.SSOToken;

import com.bookcycle.panda.webfront.constant.URLConstant;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.client.RestTemplate;

import java.util.List;

/**
 * 主页控制器
 * @author Mason
 * @date 2018/3/6
 */
@Controller
public class IndexController extends BaseController{
    @RequestMapping("/header")
    public String header(Model model){
        return "header";
    }

    @RequestMapping("/home")
    public String home(Model model){
        RestTemplate restTemplate=new RestTemplate();
        ResponseEntity<List> responseEntity=restTemplate.getForEntity(URLConstant.URL_LIST_HOUSES,List.class);
        model.addAttribute("houseList",responseEntity.getBody());
        return "home";
    }





}
